﻿using System;
using Iesi.Collections.Generic;

namespace DflyingForum.Core.Data.Domain.Entities
{
    /// <summary>
    /// 权限单元
    /// </summary>
    public class UnitRight : EntityBase
    {
        private ISet<Group> _groups;
        /// <summary>
        /// 权限名称
        /// </summary>
        public virtual string Name { get; set; }

        /// <summary>
        /// 权限枚举标识,必须具有唯一值
        /// </summary>
        public virtual int Flag { get; set; }

        public virtual ISet<Group> Groups
        {
            get { return _groups; }
            set { _groups = value; }
        }

        public UnitRight()
        {
            _groups = new HashedSet<Group>();
        }
    }
}
